from fdfs_client.client import Fdfs_client


fdfs_client = Fdfs_client("client.conf")

ret = fdfs_client.upload_appender_by_filename("02.jpeg")

print(ret)

# def storagePic(content):
#     conn = Fdfs_client(conf_path="./client.conf")
#     ret = conn.upload_appender_by_buffer(content)
#     print(ret)
#
# with open("./02.jpeg","rb") as f:
#     storagePic(f.read())
# def storagePic(content):
#     conn = Fdfs_client("./client.conf")
#     ret = conn.upload_by_buffer(content)
#     status = ret.get("Status")
#     if status != 'Upload successed.':
#         serializers.ValidationError("上传失败")
#     return ret.get("Remote file_id")
#
# with open("./123.png","rb") as f:
#     print(storagePic(f.read()))

